import java.io.*;public class FileInputStreamTest1 {    public static void main(String[] args) {        FileInputStream in = null;        try {            in = new FileInputStream("myFile.dat");            byte[] bytes = new byte[4];            while(true){                int readCount = 0;                try {                    readCount = in.read(bytes);                } catch (IOException e) {                    e.printStackTrace();                }                if(readCount == -1){                    break;                }                System.out.print(new String(bytes,0,readCount));            }        } catch (FileNotFoundException e) {            e.printStackTrace();        }    }}